<template>
123
  <div :class='$style.color'>
    的反对广泛的都是固定
    <cHild ref="child"  v-if="flag" :list="nweList" @childevent="getchild($event)"></cHild>
  <!-- <div ></div> -->
    <!-- <div v-for="item in nweList" :key="item">{{item}}</div>
    <button @click="addCount">十分士大夫精神的</button>
    {{$store.getters.newNum}} -->
    的反对广泛的都是固定的反对广泛的都是固定的反对广泛的都是固定
    <button @click="giechild">ddddd</button>
  </div>
  
  <!-- <router-view></router-view> -->
</template>
<style module>
.color{
  color: brown;
}
</style>
<script>
import cHild from '@/views/child.vue'
import { provide } from 'vue'
import * as eCharts from 'echarts'
export default {
  name: 'App',
    setup() {
    provide('echarts', eCharts)
  },
  components:{
    cHild
  },
  data() {
    return {
      list:[1,2,3,4,5,6],
      flag:false
    }
  },
  computed:{
    nweList(){
      return this.list.filter(i=>(i%2)==0)
    }
  },
  created(){
    // console.log(this.$store.state.num)
    this.getdata()
  },
  methods:{
    addCount(){
      this.$store.dispatch('asyncAddcount')
      // this.$store.commit("addConut")
    },
    getchild(a){
      console.log(a)
    },
    giechild(){
      console.log(this.$refs.child )
    },
    getdata(){
      this.flag=true
      // console.log("1231456")
    }
  }
}
</script>
